import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ModelDataVO, ModelDataForm, ModelDataQuery } from '@/api/server/modelData/types';

/**
 * 查询系统模型配置信息列表
 * @param query
 * @returns {*}
 */

export const listModelData = (query?: ModelDataQuery): AxiosPromise<ModelDataVO[]> => {
  return request({
    url: '/server/modelData/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询系统模型配置信息详细
 * @param id
 */
export const getModelData = (id: string | number): AxiosPromise<ModelDataVO> => {
  return request({
    url: '/server/modelData/' + id,
    method: 'get'
  });
};

/**
 * 新增系统模型配置信息
 * @param data
 */
export const addModelData = (data: ModelDataForm) => {
  return request({
    url: '/server/modelData',
    method: 'post',
    data: data
  });
};

/**
 * 修改系统模型配置信息
 * @param data
 */
export const updateModelData = (data: ModelDataForm) => {
  return request({
    url: '/server/modelData',
    method: 'put',
    data: data
  });
};

/**
 * 删除系统模型配置信息
 * @param id
 */
export const delModelData = (id: string | number | Array<string | number>) => {
  return request({
    url: '/server/modelData/' + id,
    method: 'delete'
  });
};
